﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using CasinoApp.Tools;
using CasinoApp.Models;
using System.ComponentModel;

namespace Axa.CasinoApp.Client.WP7
{
    public partial class SettingsPage : PhoneApplicationPage
    {
        public SettingsPage()
        {
            if (!DesignerProperties.IsInDesignTool)
            {
                Controller = Application.Current.Resources["controller"] as SlotMachineController;
                Model = Controller.SettingsModel;
            }        

            InitializeComponent();
        }

        public SettingsModel Model
        {
            get
            {
                return this.DataContext as SettingsModel;
            }
            set
            {
                this.DataContext = value;
            }
        }

        public SlotMachineController Controller { get; set; }

        private void returnBtn_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new Uri("/Views/SlotMachinePage.xaml", UriKind.Relative));
        }

        private void startBtn_Click(object sender, RoutedEventArgs e)
        {
            Controller.InitializeNewGame();
        }
    }
}